﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// Reviewed

#pragma once
#include "ElementCreationOptions.h"
#include "IElement.h"

namespace gcmp
{
    class IDocument;
    class IGraphicsElementShape;

    /// \brief 用于挂载一个 IGraphicsElementShape 对象并显示
    class GCMP_MODEL_INTERFACE_EXPORT IPureGraphicsElement : public IElement
    {
        DEFINE_CAST_DERIVED(gcmp::IPureGraphicsElement, gcmp::IElement);

    public:
        /// \brief 创建 IPureGraphicsElement 对象
        ///
        /// \param pDocument 在此文档中创建
        /// \param eco 元素创建选项
        /// \return 创建的 IPureGraphicsElement 对象
        static IPureGraphicsElement* Create(IDocument* pDocument, ElementCreationOptions eco = ElementCreationOptions::Normal);

        /// \brief 创建 IPureGraphicsElement 对象
        ///
        /// \param pDocument 在此文档中创建
        /// \param opGRep 需要显示的 IGraphicsElementShape
        /// \param eco 元素创建选项
        /// \return 创建的 IPureGraphicsElement 对象
        static IPureGraphicsElement* Create(IDocument* pDocument, gcmp::OwnerPtr<IGraphicsElementShape> opGRep, ElementCreationOptions eco = ElementCreationOptions::Normal);

        /// \brief 设置需要显示PureGrapicsElement的ModelView的ElementId
        ///
        /// 需要在哪个ModelView中显示，就将该ModelView的ElementId设置给PureGraphicsElement
        /// \param modelViewId 视图ElementId
        /// \return 返回ture表示设置成功，否则设置失败
        virtual bool SetModelViewId(ElementId modelViewId) = 0;

    public:
        /// \brief 获取Implementation Uid
        ///
        /// \return UniIdentity 返回ImplementationUid
        static UniIdentity GetImplementationUid();
    };
}



